app.service('z-request-s', [
		'$rootScope',
		'$z-http',
		'ZModel',
		function($rootScope, $http, ZModel) {
			var service = {
					saveRequest : function(data,success,fault) {
						$http.post("request/saveRequest.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					getFurloughRequestList : function(data,success,fault) {
						$http.post("request/getFurloughRequestList.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					getAwayRequestList : function(data,success,fault) {
						$http.post("request/getAwayRequestList.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					getWorkRequestList : function(data,success,fault) {
						$http.post("request/getWorkRequestList.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					updateRequest : function(data,success,fault) {
						$http.post("request/updateRequest.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					deleteRequest : function(data,success,fault) {
						$http.post("request/deleteRequest.do",
							$.param(data),
							{headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}}
							).success(function(data) {
								success(data.success);
			  				}).error(function(data) {
			  					if(fault) {
			  						fault(data);
			  				}
		  				});
					},
					getRequestHours : function(data,success,fault) {
						$http.post("requestApproval/getRequestHours.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					getAttendanceTime: function(data,success,fault) {
						$http.post("tips/getAttendanceTime.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					getLastYearYearFurlough: function(data,success,fault) {
						$http.post("restVacation/getLastYearYearFurlough.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					getBackRequest : function(data,success,fault) {
						$http.post("request/getBackRequest.do",
							$.param(data),
							{headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}}
							).success(function(data) {
								success(data.success);
			  				}).error(function(data) {
			  					if(fault) {
			  						fault(data);
			  				}
		  				});
					},
					getMorningMinutes : function(data,success,fault) {
						$http.post("requestApproval/getMorningMinutes.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					getCheckYearFurlough : function(data,success,fault) {
						$http.post("yearFurlough/getCheckYearFurlough.do",
							$.param(data),
							{headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}}
							).success(function(data) {
								success(data.success);
			  				}).error(function(data) {
			  					if(fault) {
			  						fault(data);
			  				}
		  				});
					}
			};
			return service;
		} ]);